class Settings:
    # FastAPI配置
    API_TITLE: str = "法律合同rag"
    API_VERSION: str = "v1"
    API_DESCRIPTION: str = "基于FastAPI+Ollama+Milvus的营养风险筛查评分系统"  # 描述中"营养风险筛查"可能是笔误，建议改为"法律合同检索"

    # Ollama配置
    OLLAMA_URL: str = "http://127.0.0.1:11434"
    OLLAMA_EMBEDDING_MODEL: str = "bge-m3:latest"
    OLLAMA_LLM_MODEL: str = "qwen3:8b"

    # Milvus配置
    MILVUS_HOST: str = "127.0.0.1"
    MILVUS_PORT: int = 19530
    MILVUS_COLLECTION: str = "contract_milvus_collection"
    MILVUS_DIM: int = 1024  # bge-m3输出维度（正确，bge-m3的维度确实是1024）

    # 检索器配置
    RETRIEVER_TOP_K: int = 5
    RETRIEVER_SCORE_THRESHOLD: float = 0.25

    # Redis配置
    REDIS_HOST: str = "127.0.0.1"
    REDIS_PORT: int = 6379
    REDIS_DB: int = 0
    CACHE_TTL: int = 3600  # 缓存有效期（秒）

    # 文档处理配置
    CHUNK_SIZE: int = 800
    CHUNK_OVERLAP: int = 100
    VALID_FILE_TYPES: list[str] = [".docx", ".doc", ".xlsx", ".json", ".pdf", ".txt", ".md"]  # 用list[str]替代List[str]

    # 多路召回配置
    RECALL_TOP_K: int = 5
    HISTORY_TOP_K: int = 2
    RE_RANK_TOP_K: int = 3

settings = Settings()